$.ajax({
    url: "./api/prodList",
}).then(function(res) {
    let {
        msg,
        data
    } = res;
    console.log(data);
    let strHtml = ``
    data.forEach(item => {
        strHtml += `
        <a href='./xiangqing.html?id=${item.pId}'> <div class="item">
            <p>
                <img src="${item.img}" alt="">
            </p>
            <p>
                ${item.pName}
            </p>
            <p>
                ${item.pPrice}
            </p>
        </div> </a>`;
    });

    $(".container").html(strHtml)
})